import { ResPage, Vendor } from "@/api/interface/index";
import { PROCUREDCENTER } from "@/api/config/servicePort";
import http from "@/api";

// 获取供应商列表
export const getVendorList = (params: Vendor.ReqVendorList) => {
  return http.post<ResPage<Vendor.ReqVendorList>>(PROCUREDCENTER + `/vendor/page`, params);
};

// 获取供应商列表
export const getVendorListInGoodsAdd = () => {
  return http.post<Vendor.ReqVendorList[]>(PROCUREDCENTER + `/vendor/page`);
};

// 新增供应商
export const addVendor = (params: any) => {
  return http.post(PROCUREDCENTER + `/vendor/create`, params);
};

// 批量添加供应商
export const BatchAddVendor = (params: FormData) => {
  return http.post(PROCUREDCENTER + `/vendor/import`, params);
};

// 编辑供应商
export const editVendor = (params: any) => {
  return http.post(PROCUREDCENTER + `/vendor/update`, params);
};

// 导出客户数据
export const exportVendorInfo = (params: Vendor.VendorEntity) => {
  return http.download(PROCUREDCENTER + `/vendor/export`, params);
};
